<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<c:import url="../cabecalho.jsp" />
<c:import url="../menu.jsp" />
<div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">
	<div class="row">
		<ol class="breadcrumb">
			<li>
				<a href="#">
					<span class="glyphicon glyphicon-home"></span>
				</a>
			</li>
			<li class="active">
				<fmt:message key="consulta.garantia" />
			</li>
		</ol>
	</div>
	<div class="row">
		<div class="col-lg-12">
			<h1 class="page-header">
				<fmt:message key="consulta.garantia" />
			</h1>
		</div>
	</div>
	<form:form action="consultarGarantia" commandName="produto">
		<div class="row">
			<div class="col-lg-10 col-md-10">
				<div class="panel panel-default">
					<div class="panel-heading cab">
						<fmt:message key="filtrodedados" />
					</div>
					<div class="panel-body">
						<div class="panel-body">
							<c:if test="${not empty msg && msg.tipo eq 'erro'}">
								<div class="alert alert-danger" role="alert">
									<b><fmt:message key="${msg.texto}"/></b>
									<form:errors path="dadosBasicos.modelo" cssStyle="color:black; display: block;" />
									<form:errors path="numeroDeSerie" cssStyle="color:black; display: block;" />
								</div>
							</c:if>
							<div class="col-md-12 col-lg-12">
								<div class="form-group col-md-5 col-lg-5">
									<form:label path="dadosBasicos.modelo">
										<fmt:message key="modelo" />
									</form:label>
									<form:select path="dadosBasicos.modelo" cssClass="form-control required">
										<form:option path="dadosBasicos.modelo" value=""></form:option>
										<c:forEach items="${dadosBasicos}" var="dadoBasico">
											<form:option path="dadosBasicos.modelo" value="${dadoBasico.modelo}">${dadoBasico.modelo}</form:option>
										</c:forEach>
									</form:select>
								</div>
								<div class="form-group col-md-5 col-lg-5">
									<form:label path="numeroDeSerie">
										<fmt:message key="numeroserie" />
									</form:label>
									<form:input path="numeroDeSerie" cssClass="form-control required" />
								</div>
								<div class="form-group col-md-2 col-lg-2">
									<button type="submit" class="btn btn-primary direita">
										<fmt:message key="consultar" />
									</button>
								</div>
							</div>
							<div class="col-md-12 col-lg-12">
								<div class="form-group col-md-12 col-lg-12">
									<c:if test="${not empty msg && msg.tipo eq 'sucesso'}">
										<div class="alert alert-success" role="alert">
											<h1 style="text-align:center;"><fmt:message key="${msg.texto}" /></h1>
										</div>
									</c:if>
									<c:if test="${not empty msg && msg.tipo eq 'alerta'}">
										<div class="alert alert-warning" role="alert">
											<h1 style="text-align:center;"><fmt:message key="${msg.texto}" /></h1>
										</div>
									</c:if>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
		</div>
		<input type="hidden" name="temErroForm" id="temErroForm" value="${not empty msg && msg.tipo eq 'erro' ? 'sim' : 'nao'}" />
	</form:form>
</div>
<c:import url="../rodape.jsp" />
